package health.lm.com.shop.presenter;

import java.util.ArrayList;
import java.util.List;

import health.lm.com.component_base.base.mvp.contract.XPresent;
import health.lm.com.network.callback.SimpleCallBack;
import health.lm.com.shop.activity.PeopleDiscoverActivity;
import health.lm.com.shop.entity.PeopleChainEntity;
import health.lm.com.shop.entity.PeopleDiscoverEntity;
import health.lm.com.shop.model.MallModel;

/**
 * Created by Android Studio .
 * Project：hlian health.lm.com.shop.presenter
 * Date：2019/8/16 15:07
 * Introduce：发掘人脉
 */
public class PeopleDiscoverPresenter extends XPresent<PeopleDiscoverActivity> {
    public void getData() {
        List<String> ids = new ArrayList<>();
        List<String> real_names = new ArrayList<>();
        List<String> images = new ArrayList<>();
        List<String> names = new ArrayList<>();
        List<String> tags = new ArrayList<>();
        MallModel.getInstance().getPeopleDiscoverData(new SimpleCallBack<PeopleDiscoverEntity>() {
            @Override
            public void onSuccess(PeopleDiscoverEntity pPeopleDiscoverEntity) {
                for (PeopleChainEntity.DiscoverEntity entity : pPeopleDiscoverEntity.getList()) {
                    ids.add(entity.getId());
                    real_names.add(entity.getReal_name());
                    images.add(entity.getAvatar());
                    names.add(entity.getBusiness());
                    tags.add(entity.getPosition());
                }

                if (ids.size() <= 0) return;
                if (hasV()) getV().setNewData(ids,real_names,images, names, tags);
            }
        });
//
//        for (int a = 0; a < 6; a++) {
//            images.add("http://image109.360doc.com/DownloadImg/2018/03/1008/126782666_1_2018031008485635.jpeg");
//        }
//
//        names.add("浙商总会");
//        names.add("温州商会");
//        names.add("安徽商会");
//        names.add("山西商会");
//        names.add("山东工商联合会");
//        names.add("晋商商会");

//
//        tags.add("理事长");
//        tags.add("会员");
//        tags.add("会员");
//        tags.add("会员");
//        tags.add("副会长");
//        tags.add("秘书长");
    }
}
